
def test_v_beam 
	make_v_beam("v_beam_R4", Grid*4)
	trans = Geom::Transformation.new
	$entities.add_instance( $model.definitions['v_beam'], trans )
end

def test_h_beam 
	make_h_beam( "h_beam_R8", Grid*8)
	trans = Geom::Transformation.rotation ORIGIN, [0,1,0], Math::PI/2
	$entities.add_instance( $model.definitions['h_beam'], trans )
end

def make_v_beam ( name, length )
  part_name=name+"_part1"
	make_block_component( part_name, VBeamX, VBeamY, length, $materials['wood_1'] )
	beam = $model.definitions.add(name) 
  part = $model.definitions[part_name]
	trans = Geom::Transformation.new
	beam.entities.add_instance(part, trans);
  
=begin
	part = $model.definitions[part_name]
	trans1 = Geom::Transformation.translation [ VBeamX/2+VBeamY/2, -(VBeamX), 0]
	trans2 = Geom::Transformation.rotation ORIGIN, [0,0,1], Math::PI/2
	beam.entities.add_instance(part, trans1*trans2);
=end

end

# returns beam componnent name
def make_h_beam ( prefix, length, dim_x=HBeamX, dim_y=HBeamY )
  h_beam_name = (prefix+length.to_l.to_s).gsub( /,0mm/, '' )
  puts "adding horizontal beans "+h_beam_name

  part_name=h_beam_name+"_part1"
	make_block_component( part_name, dim_x, dim_y, length, $materials['wood_1'] )
	beam = $model.definitions.add(h_beam_name) 
	part = $model.definitions[part_name]
	trans = Geom::Transformation.new
	beam.entities.add_instance(part, trans);
  return h_beam_name
end

def make_floor_main_plate
	make_block_component( "floor_main_plate", Grid*2, Grid*4, Floor_plate_strength, $materials['wood_1'] )
end


